package top.csy8888.likework.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.csy8888.likework.common.vo.ResultVO;
import top.csy8888.likework.entity.User;
import top.csy8888.likework.service.UserService;

/**
 * @author CSY
 * @date 2025 - 10 - 13
 */
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class UserController {
    private final UserService userService;

    @PostMapping("/user")
    public ResultVO<Integer> login(@RequestBody User user) {
        Integer userId = userService.login(user);
        return ResultVO.success(userId);
    }
}
